home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.m68k
- Path: phcoms4.seri.philips.nl!newssvr!cstw168!meulenbr
- From: meulenbr@natlab.research.philips.com (Frans Meulenbroeks)
- Subject: Re: Byte rotate for 68k
- Sender: news@natlab.research.philips.com (USENET News System)
- Message-ID: <meulenbr.824892703@cstw168>
- Date: Wed, 21 Feb 1996 08:51:43 GMT
- References: <4fv9qc$mu6@elektron.et.tudelft.nl> <tompatch-1602962103130001@dialip87.mm.com>
- Organization: Philips Research Laboratories Eindhoven, Netherlands
-
- In <tompatch-1602962103130001@dialip87.mm.com> tompatch@mm.com (Tom Fairfield) writes:
-
- >In article <4fv9qc$mu6@elektron.et.tudelft.nl>, bakker@morra.et.tudelft.nl
- >(jan-derk bakker) wrote:
-
- >> I'm looking for 68k code to do byte block rotation. I
- >> know there's a better word, but I can't seem to find it.
- >> The idea is to take a block of eight bytes and to transform
- >> it into another eight-byte block, where byte 0 of the
- >> output consists of all the 0-bits of the input. The rows
- >> must be transformed to the columns, so to say.
- >>
- >> Jan-Derk Bakker.
- >> J.D. Bakker, bakker@morra.et.tudelft.nl
- >> http://morra.et.tudelft.nl/~bakker/
-
- >wouldn't it be easier to do something like this
-
- > MOVE.B #7,D1
- >outer: MOVE.B #7,D0
- >inner: LSL.B (A0,D0.B)
- > ROXL.B (A0,D1.B)
-
- You probably mean A1 instead of A0.
-
- > SUBQ.B #1,D0
- > BPL inner
-
- These two can be combined into a db?? instruction
- (probably dbnz d0, inner)
-
- > SUBQ.B #1,D1
- > BPL outer
-
- >provided that A0 pointed to a COPY of the original source data and A1
- >pointed to the destination data. The LSL instruction zeros the original
- >source data.
-
- Instead of doing a roxl to (a1,d1.b), you could increament a1 (provided it
- is free for modification. This saves a few cycles calculating addresses.
- Maybe yet a few more cycles can be saved by storing the intermediate
- value in a register. E.g. have something like:
- ROXL.B D2
- and store D2 at the end.
-
- --
- Frans Meulenbroeks (meulenbr@natlab.research.philips.com)
- Philips Research Laboratories
-